/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.modules.sys.service;

import com.easy.core.persistence.Page;
import com.easy.core.service.BaseService;
import com.easy.modules.sys.entity.Office;

import java.util.Collection;
import java.util.List;

/**
 * 机构Service
 * @author easy
 * @version 2017-05-16
 */
public interface OfficeService extends BaseService {

	public List<Office> findAll();

	public List<Office> findList(Boolean isAll);


	public Office getByCode(String code);

	public List<Office> getChildren(String id);

	/**
	 * 获取单条数据
	 * @param id
	 * @return
	 */
	public Office get(String id);

	/**
	 * 获取单条数据
	 * @param officeId
	 * @return
	 */
	public Office getByOfficeId(Integer officeId);

	/**
	 * 获取单条数据
	 * @param office
	 * @return
	 */
	public Office get(Office office);

	/**
	 * 查询列表数据
	 * @param office
	 * @return
	 */
	public List<Office> findList(Office office);

	/**
	 * 查询分页数据
	 * @param page 分页对象
	 * @param office
	 * @return
	 */
	public Page<Office> findPage(Page<Office> page, Office office);

	/**
	 * 保存数据（插入或更新）
	 * @param office
	 */
	public void save(Office office);

	/**
	 * 删除数据
	 * @param office
	 */
	public void delete(Office office);


	/**
	 * 删除全部数据
	 * @param offices
	 */
	public void deleteAll(Collection<Office> offices);

	/**
	 * 删除全部数据
	 * @param offices
	 */
	public void deleteAllByLogic(Collection<Office> offices);


	/**
	 * 获取单条数据
	 * @param propertyName, value
	 * @return
	 */
	public Office findUniqueByProperty(String propertyName, Object value);

	/**
	 * 动态sql
	 * @param sql
	 */

	public List<Object> executeSelectSql(String sql);

	public void executeInsertSql(String sql);

	public void executeUpdateSql(String sql);

	public void executeDeleteSql(String sql);

}
